<template>
  <ul class="article bg-w">
    <slot></slot>
    <Loading v-if='!res.length && noData'></Loading>
    <template v-else>
      <ArticleItem
        v-for="(item, i) in res"
        :key="i"
        :article="item"
        :i="i"
        @addAgree="addAgree"
      ></ArticleItem>
    </template>
  </ul>
</template>

<script>
import ArticleItem from "@/components/main/MainComponents/article/ArticleItem";
import Loading from '@/components/common/Loading';
export default {
  name: "UserAgree",
  components: {
    ArticleItem,
    Loading
  },
  props: {
      res: {
          type: Array,
          default: () => ([])
      },
      noData: {
        type: Boolean,
        default: true
      }
  },
  methods: {
      addAgree(obj) {
          this.$emit('addAgree', obj);
      }
  },
};
</script>